package com.blog;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

//public class BlogApplication {
//
//	public static void main(String[] args) {
//		SpringApplication.run(BlogApplication.class, args);
//	}
//}

@SpringBootApplication
@EnableAsync //异步执行
@EnableScheduling //定时任务
//@EnableCaching
@MapperScan(basePackages = "com.blog.dao")
public class BlogApplication extends SpringBootServletInitializer {

    /*main方法可以去掉的，也可以开启*/
//	public static void main(String[] args) {
//		SpringApplication.run(BlogApplication.class, args);
//	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		// 注意这里要指向原先用main方法执行的Application启动类
		return builder.sources(BlogApplication.class);
	}
}
